A PLC is configured, for example, by a plurality of units such as a CPU (Central Processing Unit) unit that includes a microprocessor executing a control program, or an I/O (Input/Output) unit that manages signal input from an exterior switch or sensor and signal output to an exterior relay or actuator. The CPU unit controls a control target by repeating transmission of output data to another unit, reception of input data from another unit, and execution of a control program that uses the input data to generate the output data. The control program includes a user program that is created according to a control objective of a user. The control program may include a motion control program of which execution is instructed in the user program.
It is known that a plurality of control programs are time-divisionally executed in a PLC. For example, in Patent Literature 1 (Japanese Patent Laid-Open Publication No. 2007-140655), it is described that, in a device in which one CPU is used to process a motion control function controlling a motor and a PLC function executing sequence calculation, for each cycle of a basic clock, “a fixed-cycle motion control process and each axis process” and a “rapid sequence process” are executed, and further, in a remaining period of time of each cycle of the basic clock, a “slow sequence process” or “non-fixed-cycle motion control process” is executed. Further, it is described that, when a slow sequence process does not end within a cycle of the basic clock, the remaining of the process is executed after stopping for a period of time of a predetermined number of cycles of the basic clock.